import os
from dotenv import load_dotenv

# 根据环境变量加载对应的 .env 文件
env = os.getenv('ENV', 'dev')  # 默认加载开发环境
load_dotenv(f".env.{env}")

class Config:
    API_URL = os.getenv('API_URL','')
    SECRET_KEY = os.getenv('SECRET_KEY', '')
    DATABASE_URI = os.getenv('DATABASE_URL', '')
    DATABASE_HOST = os.getenv('DATABASE_HOST', '')
    DATABASE_USER = os.getenv('DATABASE_USER', '')
    DATABASE_PASSWORD = os.getenv('DATABASE_PASSWORD', '')
    DATABASE_DATABASE = os.getenv('DATABASE_DATABASE', '')

    # SSO配置
    SSO_SERVER_URL = os.getenv('SSO_URL', '')
    SSO_SERVER_INNER_URL = os.getenv('SSO_INNER_URL', '')
    SSO_CLIENT_ID = os.getenv('SSO_CLIENT_ID', '')
    SSO_CLIENT_SECRET = os.getenv('SSO_CLIENT_SECRET', '')
    SSO_REDIRECT_URI = os.getenv('WEB_URL','') + '/auth/login'
